package com.zhouu.example.core.util;

/**
 * 类型转换工具类
 *
 * @author zhouu
 * @date 2021-02-25 09:51
 */
public class ConvertUtil {

    private ConvertUtil() {

    }

    public static String toStr(Object value, String defaultValue) {
        if (null == value) {
            return defaultValue;
        }

        if (value instanceof String) {
            return (String) value;
        }
        return value.toString();
    }

    public static String toStr(Object value) {
        return toStr(value, null);
    }

    public static Character toChar(Object value, Character defaultValue) {
        if (null == value) {
            return defaultValue;
        }

        if (value instanceof Character) {
            return (Character) value;
        }
        String valueStr = toStr(value, null);
        StringUtils
    }
}
